package com.ft.turorial.spring.boot.vo;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 从配置文件中读取属性
 * 
 * @author lc
 *
 */
@Component
@ConfigurationProperties(prefix = "spring.datasource")
public class DataSourceProperties {
	private String username;
	private String password;
	private String url;
	private String driverClass = "com.mysql.jdbc.Driver";
	private String type;
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getDriverClass() {
		return driverClass;
	}
	public void setDriverClass(String driverClass) {
		this.driverClass = driverClass;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	@Override
	public String toString() {
		return "DataSourceProperties [username=" + username + ", password=" + password + ", url=" + url
				+ ", driverClass=" + driverClass + ", type=" + type + "]";
	}
}
